//
//  LGReportCenterHeaderView.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/9/11.
//  区头 -- 时间

#import "LGReportCenterHeaderView.h"

@interface LGReportCenterHeaderView()

/**   */
@property (nonatomic , strong)UIView *iconView;
/**   */
@property (nonatomic , strong)UILabel *dateLabel;

@end

@implementation LGReportCenterHeaderView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.iconView];
        [self addSubview:self.dateLabel];
        [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(viewPix(16));
            make.centerY.equalTo(self).offset(viewPix(5));
            make.width.equalTo(@(4));
            make.height.equalTo(@(viewPix(14)));
        }];
        [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.iconView.mas_right).offset(viewPix(12));
            make.centerY.equalTo(self.iconView);
        }];
    }
    return self;
}

-(void)setContent:(NSString *)content{
    _content = content;
    self.dateLabel.text = content;
}

-(UIView *)iconView{
    if(!_iconView){
        _iconView = [[UIView alloc] init];
        _iconView.backgroundColor = [UIColor colorWithString:@"#77D4C6"];
        _iconView.cornerRidus = 2;
    }
    return _iconView;
}

-(UILabel *)dateLabel{
    if(!_dateLabel){
        _dateLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(14, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _dateLabel;
}

@end
